This application is based upon and claims priority of Japanese Patent Application No. 2000-019450, filed Jan. 28, 2000, the contents being incorporated herein by reference.
1. Field of the Invention
The present invention relates to a read/write processing device and a read/write processing method for a disk recording medium. More particularly, the present invention relates to a read/write processing device for a disk medium that speeds up read/write processing by reordering commands and eliminating overlapping portions of write data.
2. Description of the Related Art
FIG. 2 is a block diagram of a conventional disk device 30. As shown in FIG. 2, the conventional disk device 30 includes an internal write buffer 31 wherein read/write data is temporarily stored. More particularly, write commands are speeded up by storing data from a host computer in the write buffer 31 in response to a write command, and by returning a data write complete response to the host without waiting for a disk medium 32 to complete the data write. Commands pertaining to the write data accumulated in the write buffer 31 are held in a write command queue 33, and write commands to write data to the disk medium 32 are executed by a command processor beginning with the oldest commands stored in the write command queue 33. A continuous access decision unit 35 holds the last address 36 of the write data from an immediately preceding command and determines whether or not the write data of a write command currently executed accesses an address that is continuous with the last address 36 of the write data from the immediately preceding write command.
In recent years, improvements in performance of control processors in disk devices have made it possible to reorder the write commands in the write command queue 33. More particularly, when there are multiple write commands in the write command queue 33, the write commands can be reordered by calculating, for each command in the write command queue 33, the head seek time plus the rotation wait time required to move to the start data from the final stored data position of the command currently under execution. The command corresponding to the transition that can be performed in the least amount of time is selected as the next write command. The reordering is performed by a reordering process 37.
Conventional write command reordering processes are not efficient processes for a variety of reasons, as discussed below.
If there are write commands in the write command queue that have not yet been written to the recording medium and a new read command is entered, then the new read command must wait until all write commands in the write command queue have been processed before it is executed.
If write commands that are input continuously (in terms of time) are write commands that write data to continuous addresses, then the processing of the continuous write commands cannot continue if all of the other write commands in the queue have not been completed.
If a new write command is entered corresponding to write data that overlaps with that of a write command already in the write command queue, then no consideration is given to the continuity between the overlapping command in the queue and the new command that has been entered.
The present invention solves the above and other problems of the prior art by providing a read/write processing device and method for a recording medium that efficiently reorders write commands and eliminates overlapping data.
Embodiments of the present invention are achieved with a disk device, comprising a write buffer to store data for a write command received from a host. A command queue stores commands (read and write) for which an operation for accessing a disk medium has not been completed. A reordering processor returns a data write acknowledgment and selects from the write commands stored in the command queue a next write command to be executed, the next write command to be executed being a command having a starting data storage address on the disk medium that can be reached in the least amount of time from an address on the disk medium at which the last data of a command currently being executed is stored. A command processor executes the command selected by the reordering processor.
The disk device in accordance with embodiments of the present invention may further comprise a write command overlapping data processor checking for redundancies with the data of the write commands in the command queue in response to a read command being entered while a write command is being executed; and a read command starting processor returning the write command currently being executed to the command queue and executing the read command in response to the write command overlapping data processor confirming that there is no data redundancy.
In accordance with embodiments of the present invention, a newly input read command is set to the end of the command queue when the newly input read command includes read data overlapping with the write data among the write commands in the command queue or the write command being executed, and the reordering processor selects the write command having overlapping data and the command processor executes the read command last stored in the command queue when the write command having overlapping data is executed.
The disk device in accordance with embodiments of the present invention may further comprise a write command overlapping data processor checking for redundancies with the data of a write command in the command queue in response to a write command being entered while a write command is being executed, wherein the write command overlapping data processor overwrites an overlapping data part of an existing write command in the write buffer if a part of the accessed data for the new command includes redundancies with at least a part of accessed data for the existing write command in the command queue, and replaces a corresponding part of the existing write command in the write buffer with new data, and deletes the new command when accessed data of a new write command is completely included in the existing command.
The disk device in accordance with embodiments of the present invention may further comprise a continuous access decision unit storing in memory a starting address and an ending address of the accessed data from a previous command for write commands input continuously over time, and determining that an access is continuous if the starting address of the accessed data for a new write command is between the starting address and the ending address of the accessed data of the previous command; a write buffer storage device overwriting the data from the previous command in the write buffer and storing the write data from a host in a specified position in the write buffer; and a continuous access command storage unit storing a continuous series of write commands, wherein a continuous access operation is performed by moving a write data storage location for a new command to the starting position of the redundant data when, in the write commands that are input continuously over time, an earlier half of the actual command accessed data overlaps with a later half of the accessed data for the previous command.
The disk device in accordance with embodiments of the present invention may further comprise a write command overlapping data processor determining whether accessed data is redundant with data corresponding to a write command existing in the command queue in response to entry of a next write command, and if it is determined that a portion of the accessed data for the next write command is redundant with at least a portion of the accessed data of the write command in the command queue, deleting the redundant data from the existing write command in the write buffer; and a write buffer read device continually storing to the disk medium data that has been stored in different places in the write buffer, wherein the write command overlapping data processor stores a first write command except for the redundant accessed data and a newly-input second write command continuously when the second write command has accessed data that is partially redundant with the earlier half of the accessed data of the first write command present in the command queue, and by continually performing a medium write relative to the later-half access data of first write commands having continuous addresses in the disk medium and stored in different areas of the write buffer after the medium write is performed for the second write command overlapping accessed data.
The disk device in accordance with embodiments of the present invention may further comprise a continuous access decision unit determining if the next write command is a command accessing a disk medium address continuous with an address of a write command having data currently being stored to store it to the write buffer when data is transferred from a host to the write buffer; and a largest free space detector moving a storage position in the write buffer for a next write command to a starting position of the largest free space in the write buffer in response to the continuous access decision unit determining that the continuous address cannot be accessed when the final data from the current write command is stored in the write buffer, wherein the data is stored in a continuous region of the write buffer while leaving a write buffer transfer position alone if the next write command is a command that accesses the disk medium address continuous with the current write command, and if the command does not access a continuous address on the disk medium, then the write buffer transfer position is changed to a starting position of a largest free space in free regions scattered in the write buffer and the write data is stored in the largest free space.
The disk device in accordance with embodiments of the present invention may further comprise a write buffer storage unit storing the remaining the data to other free spaces in the write buffer when an open region in the write buffer is filled completely during a storage operation to store the current write command into one open region in the write buffer when data corresponding to a write command is transferred from a host; a continuous access pointer recording device recording an indication that the remaining data has been stored in the other open regions because the data in the current write command cannot be stored in a single continuous open region in the write buffer; and a write buffer read unit storing continuous data from a different position on the write buffer on the disk medium when there is a medium write storing the data in the write buffer to the disk medium.
The disk device in accordance with embodiments of the present invention may further comprise a command processor executing a command selected by the reordering processor; a continuous access pointer unit storing in a memory a position in the write buffer that has been skipped when a buffer write is performed after data is skipped because data from another write command exists in the write buffer when a write command in a buffer write process begins the medium write; and a write buffer read device reading data from different locations and storing the data to the disk continuously when data that should be stored in a continuous region on the disk medium is stored in different places of the write buffer, wherein a reordering process is performed for the commands that perform the buffer write.
The disk device in accordance with embodiments of the present invention may further comprise a write buffer storage unit searching the contents of the write buffer in a forward and backward direction from a current buffer storage position in the write buffer when a medium write operation corresponding to a write command being entered into the write buffer begins, extracting a point where data corresponding to other commands exists at positions previous to the current storage position, and extracting a point where data corresponding to other commands is found at a position after the current storage position, and performing a buffer storage operation for new data by wrapping around the two points; and a buffer read unit reading the data from the write buffer between the two points, even when writing to the disk medium, wherein data is stored from other write segments within the write buffer where buffer writing is currently performed when the write command being input into the write buffer begins to perform the medium write.
In accordance with embodiments of the present invention, the speed of read/write processing for a disk device is increased by effectively eliminating overlapping portions when write commands are input having write data that overlaps the data in a write buffer, and by increasing the speed of processing of newly input read commands, even if there are already write commands in the write command queue that have not been processed.